package gonnectd

import (
	"github.com/cz-it/gonnectd/proto"

	"io"
)

type Request struct {
	r io.Reader
}

func (req *Request) Read(buffer []byte) *proto.Package {
	pkg := new(proto.Package)
	pkg.ReadHead(req.r)
	pkg.ReadBody(req.r, buffer)
	return pkg
}
